<br />
<p style="width:100%;text-align:center;">活动已结束</p>
<?php
exit;
session_start();
include './c/config.php';
if(isset($_GET['op'])){
    $_SESSION['openid']=$_GET['op'];
}
if (isset($_SESSION['openid'])){
    $openid='';
    if (isset($_SESSION['openid'])){
        $openid=$_SESSION['openid'];
    }
    
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
    $hasReg='false';
    $sql="select id from uinfo where openid='".$openid."'  limit 0,1 ";
    $query = $mysqli->query($sql);
    if($query->num_rows>0){
        $hasReg='true';
    }
    $mysqli->close();
    include 'home.php';
    exit;
}
header("Content-Type:text/html;charset=UTF-8");
$redirect_uri = urlencode('http://mei94.com/fyh2/b.php');
$api_userinfo_base='https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appId.'&redirect_uri='.$redirect_uri.'&response_type=code&scope=snsapi_base#wechat_redirect';
header('Location: '.$api_userinfo_base);
exit;
